using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace TestModels.Models.Mapping
{
    public class User_InfoMap : EntityTypeConfiguration<User_Info>
    {
        public User_InfoMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.Address)
                .HasMaxLength(500);

            this.Property(t => t.Tel)
                .HasMaxLength(50);

            this.Property(t => t.Position)
                .HasMaxLength(200);

            // Table & Column Mappings
            this.ToTable("User_Info");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Address).HasColumnName("Address");
            this.Property(t => t.Tel).HasColumnName("Tel");
            this.Property(t => t.Position).HasColumnName("Position");
            this.Property(t => t.Usually).HasColumnName("Usually");
        }
    }
}
